{*
 * This file is part of the Agora distribution. 
 * Detailed copyright and licensing information can be found
 * in the gpl-3.0.txt file which should be included in the distribution.
 * 
 * @version		$Id: 3.0.14 Olympus 2010-09-28 rammstein4o $
 * @copyright  2007 - 2010 jVitals
 * @license   GPLv3 Open Source
 * @link       http://jvitals.com
 * @since      File available since initial release
 *}	

{$html->toolbar->title('##Group##')}
{$html->toolbar->save('save')}
{$html->toolbar->cancel()}

<form name="adminForm" method="POST">
	{$html->form->param('option','com_agora')}
	{$html->form->param('agora_task','groups')}
	{$html->form->param('task','groups')}

	{$html->form->param('form[group_id]',$group.id)}

	<div class="col width-55">
		<fieldset>
			<legend>##Group parameters##</legend>

			<table class="admintable">
				<tbody>
					{adminform->text var='name' caption='Group name' value=$group.name}
					<tr>
						<td class="key">##Parent group##</td>
						<td>
							<select name="form[parent_id]" size="5" style="width: 200px">
								<option value="0" {if $group.parent_id == 0}selected="selected"{/if}>##Top##</option>
								{foreach from=$groups item=list_group}
								<option value="{$list_group.id}" {if $group.parent_id == $list_group.id}selected="selected"{/if}>{$html->form->treename($list_group,0)}</option>
								{/foreach}
							</select>
						</td>
					</tr>
				</tbody>
			</table>
		</fieldset>
	</div>
	<div>
		<fieldset>
			<legend>##Default permissions##</legend>
			<table class="adminlist">
				<thead>
					<th width="20%">##role##</th>
					<th>##access levels##</th>
				</thead>
				<tbody>
					{foreach from=$permissions key=role item=role_permissions}
					<tr>
						<td>
							{$roles.$role}
						</td>
						<td>
							<a href="{url task=groups action=edit_permissions type=clean group_id=$group.id role_id=$role}"
								class="modal hasTip"
								title="Forum permissions for '{$group.name}'/{$role}::{$role_permissions|@implode:'<br/>'}"
								rel="{literal}{handler: 'iframe', size: {x: 500, y: 400}}{/literal}"
							>
							{if empty($role_permissions)}
								<i>##No access##</i>
							{else}
								{$role_permissions|@implode:', '|truncate:50}
							{/if}
							</a>
						</td>
					</tr>
					{/foreach}
				</tbody>
			</table>
		</fieldset>
	</div>
</form>
